<?php

use yii\db\Migration;

class m161022_063331_create_user extends Migration
{
    public function up()
    {
        $this->createTable('kd_user', [
               'gl_id'=>$this->primaryKey()->comment('管理用户id'),
               'gl_username'=>$this->char(50)->notNull()->comment('用户名'),
               'gl_passwors'=>$this->char(50)->notNull()->comment('密码'),
               'quanxian'=>$this->integer(11)->notNull()->comment('权限1代表园长2代表幼儿园管理员3代表主班老师4副班老师5生活老师'),

                'sex' => $this->string(10)->comment('性别'),
                'age' => $this->integer(20)->comment('年龄'),
                'bj_num' => $this->integer(20)->comment('班级人数'),

               'guard_status' => $this->integer(11)->notNull()->comment('岗位状态'),
               'mobile' => $this->string(20)->comment('手机'),
               'email' => $this->string(25)->comment('邮箱'),
               'touxiang' => $this->string(50)->comment('头像'),
               'yey_id'=>$this->integer(11)->notNull()->comment('所属幼儿园id'),
               'bj_id'=>$this->integer(11)->notNull()->comment('所属幼儿园班级id'),
               'addtime'=>$this->dateTime()->notNull()->comment('添加时间'),
               'update_time'=>$this->dateTime()->null()->comment('最后修改时间'),
               'update_people'=>$this->string(50)->null()->comment  ('修改人'),
               'entry_time' => $this->dateTime()->comment('入职时间'),
               'off_time' => $this->dateTime()->comment('离职时间'),
            ]);

    }

    public function down()
    {
        $this->dropTable('kd_user');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
